import crissyService from "..";
import serverConfig from "../config";

export const toLikeAPI = (data) => {
    return crissyService({
        method: "post",
        url: `/favorite/favorite`,
        baseURL: serverConfig.favoriteServer,
        headers: { "Content-Type": "application/json" },
        data
    })
};

export const toUnLikeAPI = (data) => {
    return crissyService({
        method: "post",
        url: `/favorite/cancelFavorite`,
        baseURL: serverConfig.favoriteServer,
        headers: { "Content-Type": "application/json" },
        data
    })
};

export const toCollectAPI = (id) => {
    return crissyService({
        method: "get",
        url: `/favorite/toCollect/${id}`,
        baseURL: serverConfig.favoriteServer,
    })
};

export const getFavoritePageById = (userId, page) => {
    return crissyService({
        method: "get",
        url: `/favorite/getFavoritePageById/${userId}/${page}`,
        baseURL: serverConfig.favoriteServer,
    })
};